Command Prompt A component of Microsoft Windows |
|
---|---|
Command Prompt in Windows 7 | |
Details | |
Type | Command-line interpreter |
Included with | Windows NT Windows CE OS/2 |
Replaces | COMMAND.COM |
Related components | |
Windows PowerShell Batch file |
Command Prompt (executable name cmd.exe
) is the Microsoft-supplied command-line interpreter on OS/2, Windows CE and on Windows NT-based operating systems (including Windows 2000, XP, Vista, 7, Server 2003 and Server 2008). It is the analog of COMMAND.COM
in MS-DOS and Windows 9x (where it is called MS-DOS Prompt) systems, or of the Unix shells used on Unix-like systems.
Contents |
Therese Stowell developed the initial version of cmd.exe
for Windows NT.[1] Although some old DOS commands are unsupported or have been changed (ex: the functionality of deltree
was rolled into rd
in the form of the /s parameter), cmd.exe
still has a greater number of built-in commands.
Both the OS/2 and the Windows NT versions of cmd.exe
have more detailed error messages than the blanket "Bad command or file name" (in the case of malformed commands) of command.com. In the OS/2 version of cmd.exe
, errors are reported in the current language of the system, their text being taken from the system message files. The help command can then be issued with the error message number to obtain further information.
cmd.exe
remains part of Windows Vista, Windows Server 2008, and Windows 7.
Unlike COMMAND.COM
, which is a DOS program, cmd.exe
is a native program for the platform. This allows it to take advantage of features available to native programs on the platform that are otherwise unavailable to DOS programs. For example, since cmd.exe
is a native text-mode application on OS/2, it can use real pipes in command pipelines, allowing both sides of the pipeline to run concurrently. As a result, it is possible to redirect the standard error in cmd.exe
, unlike COMMAND.COM
. (COMMAND.COM
uses temporary files, and runs the two sides serially, one after the other.)
In reality, cmd.exe
is a Windows program that acts as a DOS-like command line interpreter. It is generally compatible, but provides extensions which address some of the limitations of COMMAND.COM
:
SETLOCAL
/ENDLOCAL
commands limit the scope of changes to the environmentCALL
and GOTO
labels lessen the need for individual batch files to perform parts of a task.SET
command are comparable to C shell.SET
command.FOR
command to support parsing files and arbitrary sets in addition to filenames.DOSKey
in COMMAND.COM
)bash
tab completionPUSHD
and POPD
commandsIF
can perform case-insensitive comparisons and numeric equality and inequality comparisons in addition to case-sensitive string comparisons^
)The extensions can be disabled, providing a stricter compatibility mode.
|